package a.f.l.a;

import a.c.d;
import a.d.t;
import a.d.w;
import a.f.tb;

import java.util.Iterator;
import java.util.List;

class yb
  extends sb
  implements p
{
  private static final double f = 1.0E-006D;
  private double g;
  private double h;
  private double i;
  private boolean j;
  private int k;
  private boolean l = false;
  
  protected void b(rb paramrb)
  {
    boolean bool = sb.e;
    super.b(paramrb);
    this.g = paramrb.e().d();
    this.k = paramrb.e().f().j();
    if ((bool) || (this.k > 0)) {
      if (bool) {}
    }
    this.l = (this.g > 0.0D);
    if ((bool) || (this.l)) {
      paramrb.a().a(this);
    }
  }
  
  protected void c(rb paramrb)
  {
    super.c(paramrb);
    if ((sb.e) || (this.l)) {
      paramrb.a().b(this);
    }
  }
  
  protected void d(rb paramrb)
  {
    super.d(paramrb);
    if ((sb.e) || (this.l)) {
      paramrb.a().b(this);
    }
  }
  
  protected double a(h paramh)
  {
    boolean bool = sb.e;
    if (!bool) {
      if (!this.l) {
        return 0.0D;
      }
    }
    if (!bool)
    {
      if (!b().b(paramh.a())) {
        if (bool) {
          break label63;
        }
      }
    }
    else {
      if (b().b(paramh.b().a())) {
        break label62;
      }
    }
    return 0.0D;
    label62:
    label63:
    a.f.o localo = a().a();
    d locald = b().d();
    t localt = localo.v(locald.e());
    jb localjb = paramh.c();
    double d1;
    double d2;
    if (localjb.a())
    {
      d1 = localt.e() + this.g;
      d2 = localt.e() + localt.c() - this.g;
      if (bool) {
        break label185;
      }
      if (sb.d == 0) {}
    }
    else
    {
      d1 = localt.d() + this.g;
      d2 = localt.d() + localt.b() - this.g;
    }
    label185:
    if (!bool) {
      if (localjb.b() + 1.0E-006D >= d1)
      {
        if (bool) {
          break label220;
        }
        if (localjb.c() - 1.0E-006D <= d2) {
          break label219;
        }
      }
    }
    return this.k;
    label219:
    label220:
    return 0.0D;
  }
  
  protected void a(List paramList)
  {
    boolean bool = sb.e;
    int i1 = sb.d;
    if (!bool) {
      if (!this.l) {
        return;
      }
    }
    a.f.o localo = a().a();
    rb localrb = b();
    d locald = localrb.d();
    t localt = localo.v(locald.e());
    int m = 0;
    int n = localrb.f();
    label66:
    label332:
    label497:
    do
    {
      if (m >= n) {
        break;
      }
      mb localmb1 = localrb.a(m);
      h localh1 = new h(localmb1);
      List localList = a().c().t().c(localmb1);
      Iterator localIterator = localList.iterator();
      do
      {
        mb localmb2;
        jb localjb1;
        double d1;
        double d2;
        do
        {
          do
          {
            do
            {
              do
              {
                do
                {
                  do
                  {
                    do
                    {
                      do
                      {
                        if (!localIterator.hasNext()) {
                          break;
                        }
                        localmb2 = (mb)localIterator.next();
                      } while (localrb.b(localmb2));
                      localjb1 = pb.a(localmb1, localmb2);
                      if (bool) {
                        break label66;
                      }
                      if (i1 != 0) {
                        break;
                      }
                      if (!localjb1.a()) {
                        break label332;
                      }
                    } while ((!bool) && (localt.c() <= 2.0D * this.g));
                    d1 = Math.max(localjb1.b(), localt.e() + this.g);
                    d2 = Math.min(localjb1.c(), localt.e() + localt.c() - this.g);
                  } while (bool);
                } while (d1 >= d2);
                localjb2 = new jb(d1, d2, localjb1.f(), true);
                localtb = pb.a(localh1, localmb2);
                localh2 = new h(localmb2);
                localh2.a(localh1);
                localh2.a(localjb2);
                localh2.a(localtb);
                paramList.add(localh2);
              } while ((!bool) && (i1 == 0));
            } while ((!bool) && (localt.b() <= 2.0D * this.g));
            d1 = Math.max(localjb1.b(), localt.d() + this.g);
            d2 = Math.min(localjb1.c(), localt.d() + localt.b() - this.g);
          } while (bool);
        } while (d1 >= d2);
        jb localjb2 = new jb(d1, d2, localjb1.f(), false);
        tb localtb = pb.a(localh1, localmb2);
        h localh2 = new h(localmb2);
        localh2.a(localh1);
        localh2.a(localjb2);
        localh2.a(localtb);
        paramList.add(localh2);
        if (bool) {
          break label497;
        }
      } while (i1 == 0);
      m++;
    } while (i1 == 0);
  }
  
  double[] a(h paramh, mb parammb, jb[] paramArrayOfjb, m[] paramArrayOfm, double[] paramArrayOfDouble)
  {
    boolean bool = sb.e;
    if (!bool) {
      if (!this.l)
      {
        b("min node corner dist penalty", 0.0D, false);
        return new double[paramArrayOfjb.length];
      }
    }
    a.f.o localo = a().a();
    d locald = b().d();
    t localt = localo.v(locald.f());
    mb localmb = paramh.a();
    if ((bool) || (!a(localt, localmb))) {
      if (bool) {}
    }
    this.j = (a(localt, parammb));
    if (!bool) {
      if (!this.j)
      {
        b("min node corner dist penalty", 0.0D, false);
        return new double[paramArrayOfjb.length];
      }
    }
    if (!bool)
    {
      if (paramArrayOfjb[0].a())
      {
        this.h = (localt.e() + this.g);
        if (bool) {
          break label223;
        }
        this.i = (localt.e() + localt.c() - this.g);
      }
    }
    else {
      if (sb.d == 0) {
        break label222;
      }
    }
    this.h = (localt.d() + this.g);
    this.i = (localt.d() + localt.b() - this.g);
    label222:
    label223:
    return super.a(paramh, parammb, paramArrayOfjb, paramArrayOfm, paramArrayOfDouble);
  }
  
  protected double a(h paramh, mb parammb, jb paramjb, m paramm, double paramDouble)
  {
    boolean bool = sb.e;
    int m = 0;
    if (!bool)
    {
      if (this.j)
      {
        if (!bool) {
          if (paramjb.b() + 1.0E-006D >= this.h)
          {
            if (bool) {
              break label83;
            }
            if (paramjb.c() - 1.0E-006D <= this.i) {
              break label71;
            }
          }
        }
        m += this.k;
      }
      label71:
      a("min node corner dist penalty", m, false);
    }
    label83:
    return m;
  }
  
  public void a(h paramh, mb parammb, jb paramjb, List paramList, rb paramrb)
  {
    boolean bool = sb.e;
    if (!bool) {
      if (this.g <= 0.0D) {
        return;
      }
    }
    a.f.o localo = a().a();
    d locald = paramrb.d();
    jb localjb = null;
    t localt = localo.v(locald.f());
    if (((bool) || (!a(localt, paramh.a()))) && ((bool) || (a(localt, parammb))))
    {
      double d1;
      double d2;
      if (!bool) {
        if (paramjb.a())
        {
          if ((!bool) && (localt.c() <= 2.0D * this.g)) {
            break label281;
          }
          d1 = Math.max(paramjb.b(), localt.e() + this.g);
          d2 = Math.min(paramjb.c(), localt.e() + localt.c() - this.g);
          if (d1 >= d2) {
            break label281;
          }
          localjb = new jb(d1, d2, paramjb.f(), true);
          break label281;
        }
      }
      if ((bool) || (localt.b() > 2.0D * this.g))
      {
        d1 = Math.max(paramjb.b(), localt.d() + this.g);
        d2 = Math.min(paramjb.c(), localt.d() + localt.b() - this.g);
        if (d1 < d2) {
          localjb = new jb(d1, d2, paramjb.f(), false);
        }
      }
    }
    label281:
    if (localjb != null) {
      paramList.add(localjb);
    }
  }
  
  private static boolean a(t paramt, mb parammb)
  {
    boolean bool = sb.e;
    w localw1 = paramt.f();
    w localw2 = new w(paramt.d + paramt.a, paramt.e + paramt.b);
    if (((bool) || (localw1.a - 1.0E-006D < parammb.i())) && ((bool) || (localw1.b - 1.0E-006D < parammb.j())) && ((bool) || (localw2.a + 1.0E-006D > parammb.k()))) {
      if (bool) {}
    }
    return localw2.b + 1.0E-006D > parammb.l();
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.l.a.yb

 * JD-Core Version:    0.7.0.1

 */